﻿namespace Lanbt.Core.Entity.Dto
{
    public abstract class ResultOutputBase
    {
        /// <summary>
        /// 返回代码
        /// </summary>
        public int Code { get; set; } = 1;

        private string _errorMsg;
        /// <summary>
        /// 错误信息
        /// </summary>
        public string ErrorMsg
        {
            get
            {
                return _errorMsg;
            }
            set
            {
                _errorMsg = value;
                Success = false;
            }
        }

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success { get; set; } = true;

        /// <summary>
        /// 耗时时间
        /// </summary>
        public long Time { get; set; }

        /// <summary>
        /// 操作人名称
        /// </summary>
        public string OperatorName { get; set; }

        /// <summary>
        /// 操作人ID
        /// </summary>
        public string OperatorId { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime OperatorTime { get => DateTime.Now; }
    }
}
